
// BingMaps
export interface BingMaps {
    cacheSize?: number;
    hidpi?: boolean;
    culture?: string;
    key: string;
    imagerySet: string;
    maxZoom?: number;
    reprojectionErrorThreshold?: number;
    tileLoadFunction?: any;
    wrapX?: boolean;
    transition?: number;
}

// ImageArcGISRest
export interface ImageArcGISRest {
    attributions?: string;
    crossOrigin?: string;
    hidpi?: boolean;
    logo?: string;
    imageLoadFunction?: any;
    params?: { [id: string]: any };
    projection?: 'EPSG:4326'|'EPSG:3857';
    ratio?: number;
    resolutions?: number[];
    url?: string;
}

// ImageWMS
export interface ImageWMS {
    attributions?: string;
    crossOrigin?: string;
    hidpi?: boolean;
    serverType?: 'carmentaserver'|'geoserver'|'mapserver'|'qgis';
    imageLoadFunction?: any;
    logo?: string;
    params?: { [id: string]: any };
    projection?: 'EPSG:4326'|'EPSG:3857';
    ratio?: number;
    resolutions?: number[];
    url?: string;
}

// TileArcGISRest
export interface TileArcGISRest {
    attributions?: string;
    cacheSize?: number;
    crossOrigin?: string;
    params?: { [id: string]: any };
    logo?: string;
    tileGrid?: any;
    projection?: 'EPSG:4326'|'EPSG:3857';
    reprojectionErrorThreshold?: number;
    tileLoadFunction?: any;
    url?: string;
    wrapX?: boolean;
    transition?: number;
    urls?: string[]
}

// TileImage
export interface TileImage {
    attributions?: string;
    cacheSize?: number;
    crossOrigin?: string;
    logo?: string;
    opaque?: boolean;
    projection?: 'EPSG:4326'|'EPSG:3857';
    reprojectionErrorThreshold?: number;
    state?: string;
    tileClass?: Function;
    tileGrid?: any;
    tileLoadFunction?: any;
    tilePixelRatio?: number;
    tileUrlFunction?: any;
    url?: string;
    wrapX?: boolean;
    transition?: number;
    urls?: string[]
}

// TileJSON
export interface TileJSON {
    attributions?: string;
    cacheSize?: number;
    crossOrigin?: string;
    jsonp?: boolean;
    reprojectionErrorThreshold?: number;
    tileJSON: 'TileJSON';
    tileLoadFunction?: any;
    url?: string;
    wrapX?: boolean;
    transition?: number;
}

// TileUTFGrid
export interface TileUTFGrid {
    jsonp?: boolean;
    preemptive: boolean;
    tileJSON: 'TileJSON';
    url?: string;
}

// TileWMS
export interface TileWMS {
    attributions?: string;
    cacheSize?: number;
    params?: { [id: string]: any };
    crossOrigin?: string;
    gutter?: number;
    hidpi?: boolean;
    logo?: string;
    tileClass?: Function;
    tileGrid?: any;
    projection?: 'EPSG:4326'|'EPSG:3857';
    reprojectionErrorThreshold?: number;
    serverType?: 'carmentaserver'|'geoserver'|'mapserver'|'qgis';
    tileLoadFunction?: any;
    url?: string;
    urls?: string[];
    wrapX?: boolean;
    transition?: number;
}

// VectorTile
export interface Vector {
    attributions?: string;
    features?: any;
    format?: any;
    loader?: any;
    logo?: string;
    overlaps?: boolean;
    strategy?: any;
    url?: string;
    useSpatialIndex?: boolean;
    wrapX?: boolean;
}

// VectorTile
export interface VectorTile {
    attributions?: string;
    cacheSize?: number;
    format?: any;
    logo?: string;
    overlaps?: boolean;
    projection?: 'EPSG:4326'|'EPSG:3857';
    state?: string;
    tileClass?: Function;
    tileGrid?: any;
    tileLoadFunction?: any;
    tileUrlFunction?: any;
    url?: string;
    urls?: string[];
    wrapX?: boolean;
    transition?: number;
}

// WMTS
export interface WMTS {
    attributions?: string;
    cacheSize?: number;
    crossOrigin?: string;
    logo?: string;
    tileGrid: any;
    projection?: 'EPSG:4326'|'EPSG:3857';
    reprojectionErrorThreshold?: number;
    requestEncoding?: string;
    layer: string;
    style: string;
    tileClass?: Function;
    tilePixelRatio?: number;
    version?: string;
    format?: string;
    matrixSet: string;
    dimensions?: object;
    url?: string;
    tileLoadFunction?: any;
    urls?: string[];
    wrapX?: boolean;
    transition?: number;
}

// XYZ
export interface XYZ {
    attributions?: string;
    cacheSize?: number;
    crossOrigin?: string;
    logo?: string;
    opaque?: boolean;
    projection?: 'EPSG:4326'|'EPSG:3857';
    reprojectionErrorThreshold?: number;
    maxZoom?: number;
    minZoom?: number;
    tileGrid?: any;
    tileLoadFunction?: any;
    tilePixelRatio?: number;
    tileSize?: number;
    tileUrlFunction?: any;
    url?: string;
    urls?: string[];
    wrapX?: boolean;
    transition?: number;
}

// Zoomify
export interface Zoomify {
    attributions?: string;
    cacheSize?: number;
    crossOrigin?: string;
    logo?: string;
    projection?: 'EPSG:4326'|'EPSG:3857';
    reprojectionErrorThreshold?: number;
    url: string;
    tierSizeCalculation?: string;
    size: number[];
    extent?: number[];
    transition?: number;
    tileSize?: number;
}

export interface Resource {
    id: string;
    title: string;
    zIndex?: number;
    visible?: boolean;
    opacity?: number;
    type: 'BingMaps'|'ImageArcGISRest'|'ImageWMS'|'TileArcGISRest'|'TileImage'|'TileJSON'|'TileUTFGrid'|'TileWMS'|'Vector'|'VectorTile'|'WMTS'|'XYZ'|'Zoomify'|'DATA',
    loading?: boolean;
    loaded?: boolean;
    config?: BingMaps | ImageArcGISRest | ImageWMS | TileArcGISRest | TileImage | TileJSON | TileUTFGrid | TileWMS | Vector | VectorTile | WMTS | XYZ | Zoomify,
    url?: string;
}

export enum ResourceTypes {
    BINGMAPS = 'BingMaps',
    IMAGEARCGISREST = 'ImageArcGISRest',
    IMAGEWMS = 'ImageWMS',
    TILEARCGISREST = 'TileArcGISRest',
    TILEIMAGE = 'TileImage',
    TILEJSON = 'TileJSON',
    TILEUTFGRID = 'TileUTFGrid',
    TILEWMS = 'TileWMS',
    VECTOR = 'Vector',
    VECTORTILE = 'VectorTile',
    WMTS = 'WMTS',
    XYZ = 'XYZ',
    ZOOMIFY = 'Zoomify',
    DATA = 'DATA'
}